How to add a string to a string?

Like this

string a = "a"
string b = "b"
string x = a+b

print x

Output => ab

???

 


meinhana - Wed Aug 05 03:58:58 EDT 2015

Re: How to add a string to a string?
meinhana - Wed Aug 05 06:57:21 EDT 2015

I found a method

string a = "a"
string b = "b"
Buffer x = create
x += a
x += b

string ok = stringOf(x)

print ok

Output => ab

Re: How to add a string to a string?
Mathias Mamsch - Wed Aug 05 07:22:47 EDT 2015

meinhana - Wed Aug 05 06:57:21 EDT 2015

I found a method

string a = "a"
string b = "b"
Buffer x = create
x += a
x += b

string ok = stringOf(x)

print ok

Output => ab

Look in the DXL Manual under Basic Types, String operations - there you can see that string concatenation in DXL is done (unlinke any other language) using a simple " " (space). E.g.:

string x = "a"
string y = "b"
string z = x y
print z

regards, Mathias

Re: How to add a string to a string?
meinhana - Wed Aug 05 07:36:15 EDT 2015

Mathias Mamsch - Wed Aug 05 07:22:47 EDT 2015

Look in the DXL Manual under Basic Types, String operations - there you can see that string concatenation in DXL is done (unlinke any other language) using a simple " " (space). E.g.:

string x = "a"
string y = "b"
string z = x y
print z

regards, Mathias

Thank you for your answer, but i cant find in the manual the point "basic types"

Only "basic functions" and "types" under "introduction"

Re: How to add a string to a string?
Mathias Mamsch - Wed Aug 05 09:29:42 EDT 2015

meinhana - Wed Aug 05 07:36:15 EDT 2015

Thank you for your answer, but i cant find in the manual the point "basic types"

Only "basic functions" and "types" under "introduction"

I was referring to the chapter "Fundamental types and function" (Chapter 9) ... This chapter, the chapter "General Language Facilities" (Chapter 10?) and the "Introduction" (Chapter 1?) are the absolute must reads, when you start with DXL. Normally it helps, to read them several times, there is a lot of useful information in there. Regards, Mathias